package com.sumainfor.wx.tenant.controller;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.wx.tenant.feign.OperationsFeignClient;
import com.sumainfor.wx.tenant.feign.Zfeign.ZzuulFeign;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 退租详情
 * <p>
 *
 * @author: zhoucong
 * @create: 2019-05-27 14:14
 **/
@Controller
@RequestMapping("/withEva")
public class WithdrawalEvaController {

    @Autowired
    ZzuulFeign zzuulFeign;

    @Autowired
    OperationsFeignClient operationsFeignClient;

    /**
    * <p>
    * 根据退租账单编号获取退租生活费用清单
    * </p>
    *
    * @author: zhoucong
    * @since:
    */
    @ResponseBody
    @GetMapping("/getWithArticleEvaList")
    public JsonResult getWithArticleEvaList(@RequestParam Map<String,Object> params){
        return operationsFeignClient.getWithArticleEvaList(params);
    }

    /**
     * <p>
     * 获取管家的姓名和图像等
     * </p>
     *
     * @author: zhoucong
     * @since:
     */
    @ResponseBody
    @PostMapping("/getSystemUser")
    public JsonResult getSystemUser(@RequestBody Map<String,Object> params){
        params.put("user_id", MapUtils.getString(params,"SysUserId"));
        System.out.println("Params"+params);
        return zzuulFeign.getSystemUser(params);
    }
}
